package houseHold.waterObjects;

import houseHold.ObjectType;

import java.util.Vector;

/**
 * Objects that use water
 * 
 * @author Minodor Class used for matching XML objects to java Objecs
 */
public enum WaterObjectType implements ObjectType {
	BATHTUB, SHOWER, SINK, TOILET, WATER_OBJECT;
	public Vector<String> getList() {
		Vector<String> ret = new Vector<String>();
		for (WaterObjectType w : WaterObjectType.values()) {
			ret.add(w.toString());
		}
		ret.remove("WaterObject");
		return ret;
	}

	public WaterObjectType getObject(String s) {
		for (WaterObjectType w : WaterObjectType.values()) {
			if (w.toString().equalsIgnoreCase(s))
				return w;
		}
		return null;
	}

	@Override
	public ObjectType match(String value) {
		return getObject(value);
	}

	@Override
	public String toString() {
		switch (this) {
		case SINK:
			return "Sink";
		case BATHTUB:
			return "Bathtub";
		case TOILET:
			return "Toilet";
		case SHOWER:
			return "Shower";
		default:
			return "WaterObject";
		}
	}
}
